﻿@{
    Layout = null;
}
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>个人中心-@{@WorkContext.MallConfig.SiteTitle}触屏版</title>
    @Html.Raw(WorkContext.MallConfig.SEOKeyword)
    @Html.Raw(WorkContext.MallConfig.SEODescription)
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="@{@WorkContext.CSSCDN}/mobile/css/base.css" rel="stylesheet" type="text/css">
    <link href="@{@WorkContext.CSSCDN}/mobile/css/ucenter.css" rel="stylesheet" type="text/css">
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/common.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/ucenter.user.js" type="text/javascript"></script>
</head>

<body>
<header>
  <div class="new-header">
    <a href="javascript:pageBack()" class="new-a-back"><span>返回</span></a>
    <h2>个人中心</h2>
    <a href="javascript:navSH()" class="new-a-brn"><span>BRN键</span></a> 
  </div>
  <div class="new-brn-tab" id="nav" style=" display:none;">
    <div class="new-tbl-type"> 
    <a href="@Url.Action("index", "home")" class="new-tbl-cell"><span class="icon">首页</span><p style="color:#6e6e6e;">首页</p></a> 
    <a href="@Url.Action("list", "category")" class="new-tbl-cell"><span class="icon2 on">分类搜索</span><p style="color:#6e6e6e;" class="on">分类搜索</p></a> 
    <a href="@Url.Action("index", "cart")" class="new-tbl-cell"><span class="icon3">购物车</span><p style="color:#6e6e6e;">购物车</p></a> 
    <a href="@Url.Action("index", "ucenter")" class="new-tbl-cell"><span class="icon4 on">个人中心</span><p style="color:#6e6e6e;" class="on">个人中心</p></a> 
    </div>
  </div>
</header>

<div class="memberbg"></div>
<div class="memberwrapper">
<div class="div-user">
<div class="user">
<img src="@{@WorkContext.ImageCDN}/mobile/images/member.png" class="memberavatar" />
<div class="memberinfo"><span class="membername">@WorkContext.NickName</span><span class="memberlevel">@WorkContext.UserRTitle</span></div>
</div>
</div>
</div>

<div class="memberNavBox">
  <ul class="memberNav">
  @{
      int payOrderCount = Orders.GetUserOrderCount(WorkContext.Uid, "", "", (int)OrderState.WaitPaying);
      }
    <li><a class="link link1" href="@Url.Action("orderlist", new RouteValueDictionary { { "orderState", (int)OrderState.WaitPaying } })">待付款<span class="tip_num">@payOrderCount</span></a></li>
    <li><a class="link link2" href="@Url.Action("orderlist", new RouteValueDictionary { { "orderState", (int)OrderState.Sended } })">待收货</a></li>
    <li><a class="link link3" href="@Url.Action("orderlist")">订单列表</a></li>
    <li><a class="link link5" href="@Url.Action("paycredit")">我的资产</a></li>
    <li><a class="link link6" href="@Url.Action("account")">帐户中心</a></li>
  </ul>
</div>


<ul class="tab">
    <li><a class="item hot" id="tab1" onclick="changeTab(1)">我的关注</a></li>
    <li><a class="item" id="tab2" onclick="changeTab(2)">店铺收藏</a></li>
    <li><a class="item" id="tab3" onclick="changeTab(3)">浏览记录</a></li>
</ul>
<div class="clear"></div>

<div class="tabCon" id="tabCon1">
  <ul class="proList" id="favoriteProductListBlock">
    @{
        DataTable productList = FavoriteProducts.GetFavoriteProductList(5, 1, WorkContext.Uid);
        }
    @foreach (DataRow row in productList.Rows)
    {
    <li id="favoriteProduct@{@row["pid"]}"> 
      <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", row["pid"] } })"><img src="@{@WorkContext.ImageCDN}/upload/store/@row["storeid"]/product/show/thumb60_60/@row["showimg"]"></a>
      <div class="description">
          <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", row["pid"] } })"> <span class="title">@row["name"]</span> <span class="price">¥@row["shopprice"]</span> </a> 
          <a href="javascript:delFavoriteProduct(@row["pid"])" class="del delFavorite"></a> 
      </div>
    </li>
    }
    @*<div id="focus"></div>*@
  </ul>
</div>
<div class="tabCon" id="tabCon2"><ul class="favDP" id="favoriteStoreListBlock"></ul></div>
<div class="tabCon" id="tabCon3"><ul class="proList" id="browseProductListBlock"></ul></div>
<div class="loading">
<a id="lastPagePrompt" style="display:none;" href="javascript:void(0);" class="loadMore">没有了</a>
<div id="loadPrompt" style="display:none;" class="loadAnimate"><p class="list-loading"><span></span>加载中...</p></div>
</div>
<div class="clear"></div>

<script type="text/javascript">
    var tabType = 1;
    var isInitFavoriteStoreList = false;
    var isInitBrowseProductList = false;
    function changeTab(i) {
        tabType = i;
        for (var j = 1; j <= 3; j++) {
            document.getElementById("tab" + j).className = "item";
            document.getElementById("tabCon" + j).style.display = "none";
        }
        document.getElementById("tab" + i).className = "item hot";
        document.getElementById("tabCon" + i).style.display = "block";
        if (i == 2 && !isInitFavoriteStoreList) {
            document.getElementById("lastPagePrompt").style.display = "none";
            getFavoriteStoreList(fsListNextPageNumber);
         }
        else if (i == 3 && !isInitBrowseProductList) {
            document.getElementById("lastPagePrompt").style.display = "none";
            getBrowseProductList(bpListNextPageNumber);
        }
    }

    function whenScroll() {
        if (document.documentElement.scrollTop + document.documentElement.clientHeight > document.documentElement.scrollHeight - 10 && !isLoading) {
            if (tabType == 1) {
                getFavoriteProductList(fpListNextPageNumber);
            }
            else if (tabType == 2) {
                getFavoriteStoreList(fsListNextPageNumber);
            }
            else {
                getBrowseProductList(bpListNextPageNumber);
            }
        }
    }
    document.documentElement.onscroll = whenScroll;
</script>
<div class="viewport">
  <footer>
    <div class="footerTop">
      @if (WorkContext.Uid < 1)
      {
      <div class="left"><a href="@Url.Action("login", "account", new RouteValueDictionary { { "returnUrl", WorkContext.Url } })">登录</a> | <a href="@Url.Action("register", "account")">注册</a></div>
      }
      else
      {
        <div class="left"><a href="@Url.Action("index", "ucenter")">@WorkContext.NickName</a> | <a href="@Url.Action("logout", "account")">退出</a></div>   
      }
      <div class="right"><a href="#top">回到顶部 </a></div>
      <div class="clear"></div>
    </div>
    <div class="footerCon"><a href="@Url.Action("index", "home")" class="hot">触屏版</a><a href="/">电脑版</a></div>
    <div class="copyright" align="center">www.brnmall.com </div>
  </footer>
</div>
@Html.Raw(WorkContext.MallConfig.Script)
</body>
</html>
